package com.learng.springcloud.service;

import com.learng.springcloud.entity.Member;
import com.learng.springcloud.vo.MemberVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created by zhouwei on 2020/7/27.
 */
@Service
@FeignClient(name="member-service", fallback = MemberFeignFallbackService.class)
//@RequestMapping("/member")
public interface MemberFeignService {

    @RequestMapping("/member/getAll")
    List<Member> getAll();

    @RequestMapping("/member/findByCondition")
    List<Member> findByCondition(MemberVo condition);

    @RequestMapping("/member/findByRequestParam")
    List<Member> findByRequestParam(@RequestParam(value = "id") Long id, @RequestParam(value = "name") String name);

    @RequestMapping("/member/findByRequestBody")
    List<Member> findByRequestBody(@RequestBody MemberVo condition);
}
